package com.chenailin.www.dao;

import com.chenailin.www.pojo.Appointment;

import java.sql.SQLException;
import java.time.LocalDate;
import java.util.List;

public interface AppointmentDAO {

    // 添加挂号记录
    boolean insertAppointment(Appointment appointment) throws SQLException;

    // 删除挂号记录
    boolean deleteAppointment(int id) throws SQLException;

    // 是否通过身份验证
    boolean isVerified(int userId);

    // 检查是否重复预约
    boolean hasConflict(int userId, int slot);

    // 查询挂号时间段
    int getSchedule(int id);

    // 查找挂号记录
    List<Appointment> findByUserId(int userId);

    // 根据编号查找挂号记录
    Appointment findById(int id);

    // 标记医生为已选择
    boolean selectDoctor(int id, int slot);

    // 标记医生为空闲
    boolean unSelectDoctor(int id, int slot);

    // 查找每日病人数量
    int getDailyAppointments(int id, LocalDate date);

}